﻿// Copyright (c) 2017 GlassGrass

using System.Collections.Generic;
using System.Linq;
using UniRx;
using UnityEngine;



namespace GlassGrass.Unity.GuiFramework
	{
	/// <summary> Container element that can has some children. </summary>
	public abstract class ContainerBase : GuiElement, IContainer
		{

		#region event

		/// <summary> Be fired when child was added. </summary>
		public IObservable<GuiElement> ChildAdded => _containerImpl.ChildAdded;
		

		/// <summary> Be fired when child was removed. </summary>
		public IObservable<GuiElement> ChildRemoved => _containerImpl.ChildRemoved;
		
		#endregion



		#region properties and fields

		/// <summary> [get] Child GUI element of this </summary>
		public IList<GuiElement> Children => _containerImpl.Children;


		private readonly ContainerComponent _containerImpl = new ContainerComponent();

		#endregion



		/// <summary></summary>
		/// <param name="config"> [Non-Nullable] </param>
		/// <exception cref="System.ArgumentNullException"></exception>
		protected ContainerBase(GuiConfig config) : base(config)
			{
			}


		

		}
	}
